<?php
require_once('db.php');

$term = trim(strip_tags($_GET['term']));

$qstring = "SELECT prod_name,prod_id  FROM tb_product WHERE prod_id LIKE '%".$term."%'";
$result = @mysql_query($qstring,$link);
$set = "";
while ($row = @mysql_fetch_array($result,MYSQL_ASSOC))
{
		$id 	= htmlentities(stripslashes($row['prod_id']));
		$name 	= htmlentities(stripslashes($row['prod_name']));
		
		//if (@strpos(@strtolower($id), $term) !== false)  {
			$set .=  "$id|$name\n";
		//}
		
}
echo $set;

?>